﻿using GalaSoft.MvvmLight.Messaging;
using JiveMessenger.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace JiveMessenger.Views
{
    /// <summary>
    /// Interaction logic for DownloadProgress.xaml
    /// </summary>
    public partial class UpdateDownloadProgress : Window
    {
        public UpdateDownloadProgress(string title)
        {
            InitializeComponent();
            this.DataContext = new ViewModelUpdateDownloadProgress(title);
            Messenger.Default.Register<NotificationMessage>(this, msg =>
            {
                if (msg.Notification == "CloseWindow" && (msg.Sender == this.DataContext))
                {
                    this.Close();
                }
            });
        }
    }
}
